<%@page import="entity.Student"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
 	<script>
 	 $(function(){
 	 	$("#refresh").click(function(){
 	 		$("#vcode").attr("src","vcodeServlet?"+Math.random());
 	 	
 	 		return false;
 	 	});
 	 });
 	</script>
  </head>
  
  <body>
  <h1 style="color:red;">${msg}</h1>
  <%
  Student o =(Student)session.getAttribute("USER_LOGIN");
  if(o==null){
   %>
    Login <br>
    <form action="doLogin.jsp" method="post">
      学号:<input name="uname"/>
      password:<input type="password" name="pass"/>
      <br/>
      验证码:<img src="vcodeServlet" id="vcode"/>
      <input type="text" name="code"/>
      <a  id="refresh" href="javascript:void(0)">看不清楚？点击刷新</a>
      <input type="submit" value="login"/>
    </form>
    <%}else{ %>
      欢迎<%=o.getSname()%>,您已经登录
    <%} %>
  </body>
</html>
